package com.combetter.changxing.db.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.combetter.changxing.db.entity.User;


/**
 * Created by 深圳唐龙飞讯科技有限公司 on 2018/7/5.
 */
@Dao
public interface UserDao {
    /**
     * 查询用户信息
     *
     * @return
     */
    @Query("SELECT * FROM user_table")
    User getUserInfo();

    /**
     * 添加用户信息
     *
     * @param users
     */
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insertUser(User... users);

    /**
     * 更新用户信息
     *
     * @param users
     */
    @Update
    void updateUser(User... users);

    /**
     * 删除用户信息
     *
     */
    @Delete
    void deleteUser(User user);

}
